function product_pagination(current_page, total_pages) {
    let pages_text = ""
    if (current_page === 1) {//第一页则previous不可点击
        pages_text += "<li class='page-item disabled'><a class='page-link' aria-label='Previous'> <span aria-hidden='true'>&laquo;</span> </a> </li>"
    } else {
        pages_text += "<li onclick='getPageInfo(" + (current_page - 1) + ")' class='page-item'><a class='page-link' aria-label='Previous'> <span aria-hidden='true'>&laquo;</span> </a> </li>"
    }
    let start_i = (Math.floor((current_page + 5 - 1) / 5) - 1) * 5 + 1
    var end_i;
    if (start_i + 5 < total_pages) {
        end_i = start_i + 5
    } else {
        end_i = total_pages + 1
    }
    for (var i = start_i; i < end_i; i++) {
        if (current_page === i) {
            //保证当前页面的下标是不可点击的
            pages_text += ("<li class='page-item active'> <a class='page-link'>" + i + "</a> </li>")
        } else {
            pages_text += ("<li onclick='getPageInfo(" + i + ")' class='page-item'> <a class='page-link'>" + i + "</a> </li>")
        }
    }
    if (current_page === total_pages) {//最后一页则next不可点击
        pages_text += "<li class='page-item disabled'> <a class='page-link' aria-label='Next'> <span aria-hidden='true'>&raquo;</span> </a> </li>"
    } else {
        pages_text += "<li onclick='getPageInfo(" + (current_page + 1) + ")' class='page-item'> <a class='page-link' aria-label='Next'> <span aria-hidden='true'>&raquo;</span> </a> </li>"
    }
    //尾页
    pages_text += "<li onclick='getPageInfo(" + total_pages + ")' class='page-item'><a class='page-link'> 尾页 </a></li>"
    //跳转
    pages_text += "<li>" +
        " <input id='page_input' style='position: relative;float:left;display: inline-block;width: 80px;border-radius: 0;' type='text' class='form-control' placeholder='页码'>" +
        "<button id='page_btn' onclick='jumpPage()' style='border-radius: 0' class='btn btn-primary' type='submit'>跳转</button>" +
        "</li>"
    $("#product_pagination").html(pages_text)
}
function jumpPage () {// 监听按钮的点击事件
        // 获取输入框的值
        var inputValue = $("#page_input").val();
        // 传入输入框的值
        getPageInfo(inputValue);
}